package com.o2o.app.userCenter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.o2o.app.R;

public class MineFamilyActivity extends Activity {
	/**
	 * 加入家庭按钮
	 */
	private Button btn_add;

	/**
	 * 创建家庭按钮
	 */
	private Button btn_creat;

	/**
	 * 我的家庭返回按钮
	 */
	private Button btn_back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.mine_family);

		initViews();
	}

	private void initViews() {
		btn_add = (Button) findViewById(R.id.btn_add);
		btn_add.setOnClickListener(new ClickEvent());

		btn_creat = (Button) findViewById(R.id.btn_creat);
		btn_creat.setOnClickListener(new ClickEvent());

		btn_back = (Button) findViewById(R.id.btn_back);
		btn_back.setOnClickListener(new ClickEvent());
	}

	/**
	 * 点击事件
	 * 
	 * @author Administrator
	 * 
	 */
	class ClickEvent implements View.OnClickListener {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.btn_add: { // 点击加入家庭
				Intent intent = new Intent(MineFamilyActivity.this,
						MineFamilyTypeActivity.class);
				intent.putExtra("type", "1");
				startActivity(intent);
			}
				break;

			case R.id.btn_creat: { // 创建家庭
				Intent intent = new Intent(MineFamilyActivity.this,
						MineFamilyTypeActivity.class);
				intent.putExtra("type", "2");
				startActivity(intent);
			}
				break;

			case R.id.btn_back: { // 返回
				finish();
			}
				break;
			default:
				break;
			}
		}

	}
}
